-- background: 72461 from stack: in.1 -- bmap block id: 74486 -- flags: 4000 -- background id: 0 -- name: ----- HyperTalk script ----- On PutSubject SubName, SubRef Global Subject, PrevSubject if the hilite of card button SubName is true then put true into item SubRef of Subject if PrevSubject>SubRef then put SubRef into PrevSubject end if else put false into item SubRef of Subject end if end PutSubject On PutTense TenseName, TenseRef Global Tense, FmrTense if the hilite of card button TenseName is true then put true into item TenseRef of Tense if FmrTense>TenseRef then put TenseRef into PrevTense end if else put false into item TenseRef of Tense end if end PutTense Function GetSubject Global Subject, PrevSubject put 0 into SubRef repeat with count=1 to 6 if item count of Subject is true then if count>PrevSubject then put count into SubRef exit repeat end if end if end repeat return SubRef end GetSubject Function GetTense Global Tense,FmrTense put 0 into TenseRef repeat with count=1 to 8 if item count of Tense is true then if count>FmrTense then put count into TenseRef exit repeat end if end if end repeat return TenseRef end GetTense on DoQuestion Global PrevSubject, FmrTense, Answer, CurrentConj if the hilite of card button "Some Subjects" is true then put GetSubject() into QuizSub if QuizSub is 0 then put 0 into PrevSubject put GetSubject() into QuizSub if QuizSub is 0 then put 1 into QuizSub click at the loc of card button "All Subjects" end if end if put QuizSub into PrevSubject else put Random(6) into QuizSub end if if the hilite of card button "Some Tenses" is true then put GetTense() into QuizTense if QuizTense is 0 then put 0 into FmrTense put GetTense() into QuizTense if QuizTense is 0 then put 1 into QuizTense click at the loc of card button "All Tenses" end if end if put QuizTense into FmrTense if QuizTense is 6 then put 5+Random(4) into QuizTense else if QuizTense is 7 then put 9+Random(4) into QuizTense else if QuizTense is 8 then put 13+Random(4) into QuizTense end if end if end if else put Random(17) into QuizTense end if push card lock screen go to any card of background id 2629 put bg field "Verb" into QuizVerb get Offset("(",QuizVerb) if it>0 then put first word of bg field "Verb" into QuizVerb if (the hilite of cd btn "Irregular 1" is true) and (QuizTense is 1) then get "Present"&QuizSub put background field it into Answer else if (the hilite of cd btn "Irregular 2" is true) and (QuizTense is 2) then get "Preterite"&QuizSub put background field it into Answer else Conjugate background field "Verb",QuizTense,Normal get "Normal"&QuizSub put background field it into Answer get background field "SubjectRef" if QuizSub is not it then FormVerb It end if end if pop card SetQuizCard QuizVerb,QuizSub,QuizTense put empty into card field "Response" unlock screen click at the loc of card field "Response" end DoQuestion on SetQuizCard Verb,Person,Tense put Verb into card field "QVerb" if Person is 1 then put "Yo" into card field "QPerson" if Person is 2 then put "Tú" into card field "QPerson" if Person is 3 then put "él,ella,Ud." into card field "QPerson" if Person is 4 then put "Nosotros" into card field "QPerson" if Person is 5 then put "Vosotros" into card field "QPerson" if Person is 6 then put "ellos,ellas,Uds." into card field "QPerson" if Tense is 1 then put "Present" into card field "QTense" if Tense is 2 then put "Preterite" into card field "QTense" if Tense is 3 then put "Imperfect" into card field "QTense" if Tense is 4 then put "Future" into card field "QTense" if Tense is 5 then put "Conditional" into card field "QTense" if Tense is 6 then put "Present Progressive" into card field "QTense" if Tense is 7 then put "Past Progressive" into card field "QTense" if Tense is 8 then put "Conditional Progressive" into cd fld "QTense" if Tense is 9 then put "Future Progressive" into card field "QTense" if Tense is 10 then put "Present Perfect" into card field "QTense" if Tense is 11 then put "Pluperfect" into card field "QTense" if Tense is 12 then put "Future Perfect" into card field "QTense" if Tense is 13 then put "Conditional Perfect" into cd fld "QTense" if Tense is 14 then put "Present Subjunctive" into cd fld "QTense" if Tense is 15 then put "Imperfect Subjunctive" into cd fld "QTense" if Tense is 16 then put "Present Perfect Subjunctive" into cd fld "QTense" if Tense is 17 then put "Pluperfect Subjunctive" into cd fld "QTense" end SetQuizCard